package tx.bjdacp.dao;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bjdacp.model.*;
import tx.bjdacp.dao.*;
import tx.bjdacp.service.*;
import tx.bjdacp.vo.query.*;


import static cn.org.rapid_framework.util.ObjectUtils.*;
import org.springframework.stereotype.Repository;

@Repository
public class DrugSellUnitModifyLogDao extends BaseHibernateDao<DrugSellUnitModifyLog,java.lang.Integer>{

	public Class getEntityClass() {
		return DrugSellUnitModifyLog.class;
	}

	public Page findPage(DrugSellUnitModifyLogQuery query) {
        // [column]为字符串拼接, {column}为使用占位符. [column]为使用字符串拼接,如username='[username]',偷懒时可以使用字符串拼接
        // [column] 为PageRequest的属性
		String sql = "select t from DrugSellUnitModifyLog t where 1=1 "
			  	+ "/~ and t.drugSellUnitId = {drugSellUnitId} ~/"
			  	+ "/~ and t.userInfoId = {userInfoId} ~/"
			  	+ "/~ and t.unitName like '%[unitName]%' ~/"
			  	+ "/~ and t.registAddress like '%[registAddress]%' ~/"
			  	+ "/~ and t.artificialPerson like '%[artificialPerson]%' ~/"
			  	+ "/~ and t.unitPrincipal like '%[unitPrincipal]%' ~/"
			  	+ "/~ and t.qualityPrincipal like '%[qualityPrincipal]%' ~/"
			  	+ "/~ and t.apothecary like '%[apothecary]%' ~/"
			  	+ "/~ and t.apothecary2 like '%[apothecary2]%' ~/"
			  	+ "/~ and t.apothecaryChina like '%[apothecaryChina]%' ~/"
			  	+ "/~ and t.sellMode like '%[sellMode]%' ~/"
			  	+ "/~ and t.sellArea like '%[sellArea]%' ~/"
			  	+ "/~ and t.storageAddress like '%[storageAddress]%' ~/"
			  	+ "/~ and t.licenceCode like '%[licenceCode]%' ~/"
				+ "/~ and t.unitFoundDate >= {unitFoundDateBegin} ~/"
				+ "/~ and t.unitFoundDate <= {unitFoundDateEnd} ~/"
				+ "/~ and t.licenceGiveDate >= {licenceGiveDateBegin} ~/"
				+ "/~ and t.licenceGiveDate <= {licenceGiveDateEnd} ~/"
				+ "/~ and t.licenceExpiryDate >= {licenceExpiryDateBegin} ~/"
				+ "/~ and t.licenceExpiryDate <= {licenceExpiryDateEnd} ~/"
			  	+ "/~ and t.gspCode like '%[gspCode]%' ~/"
				+ "/~ and t.gspGiveDate >= {gspGiveDateBegin} ~/"
				+ "/~ and t.gspGiveDate <= {gspGiveDateEnd} ~/"
				+ "/~ and t.gspExpiryDate >= {gspExpiryDateBegin} ~/"
				+ "/~ and t.gspExpiryDate <= {gspExpiryDateEnd} ~/"
			  	+ "/~ and t.isLogout = {isLogout} ~/"
			  	+ "/~ and t.logoutDate = {logoutDate} ~/"
			  	+ "/~ and t.mobelPhone like '%[mobelPhone]%' ~/"
			  	+ "/~ and t.phone like '%[phone]%' ~/"
			  	+ "/~ and t.isTourDrugstore = {isTourDrugstore} ~/"
			  	+ "/~ and t.isSellChineseMedicine = {isSellChineseMedicine} ~/"
			  	+ "/~ and t.isOtcunit = {isOtcunit} ~/"
			  	+ "/~ and t.isResendLicense = {isResendLicense} ~/"
				+ "/~ and t.modifyDate >= {modifyDateBegin} ~/"
				+ "/~ and t.modifyDate <= {modifyDateEnd} ~/"
			  	+ "/~ and t.modifyProceeding = {modifyProceeding} ~/"
				+ "/~ order by [sortColumns] ~/";


		return pageQuery(sql,query);
	}


}
